package Demo7;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-12-22
 * Time: 11:29
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = "";
        StringBuilder stringBuilder = new StringBuilder();
        while (!s.equals("end")){
            s = sc.next();
            if (s.length()%3==0&&!s.equals("end")){
                stringBuilder.append(s+" ");
            }
        }
        System.out.println(stringBuilder);
    }
}
